package com.gateway.server.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author yin_q
 * @Date 2019/8/28 17:15
 * @Email yin_qingqin@163.com
 **/
@Configuration
public class RibbonConfig {

    /**
     * @LoadBalanced 注解表明这个restRemplate开启负载均衡的功能
     * @return
     */
    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
